/**
 * 北京钉图互动科技 all right reserver
 */
package com.impress.server.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.impress.commons.exception.rpc.RemoteCallExceptionConfiguration;
import com.impress.commons.exception.translate.ExceptionErrorCodeRegistar;
import com.impress.commons.exception.translate.ExceptionTranslatorConfiguration;
import com.impress.commons.jackson.QuietObjectMapper;

/**
 * @author Wangyi
 * @since 2016年6月24日
 */
@Configuration("serverApplicationConfiguration")
@Import({ ExceptionTranslatorConfiguration.class, RemoteCallExceptionConfiguration.class })
@ImportResource("classpath*:/data-access-live/data-access.xml")
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })
@EnableScheduling
public class ApplicationConfiguration {

	@Autowired
	private ExceptionErrorCodeRegistar exceptionErrorCodeRegistar;

	/*@PostConstruct
	public void registerErrorCodes() {
		this.exceptionErrorCodeRegistar.registerErrorCode(LiveErrors.class);
	}*/
	
	@Bean
	public QuietObjectMapper quietObjectMapper(ObjectMapper objectMapper) {
		return new QuietObjectMapper(objectMapper);
	}
}
